package com.qfmy.app.controller.novel;

import com.qfmy.app.service.novel.RatingService;
import com.qfmy.common.result.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 清风明月
 * @Package com.qfmy.app.controller.novel
 * @date 2025/4/15
 * @description 小说的评分
 */
@RestController
@RequestMapping("/app/rating")
@SuppressWarnings("all")
public class RatingController {

    /**
     * 注入服务层
     */
    @Resource
    private RatingService ratingService;

    /**
     * 对小说进行评分
     */
    @RequestMapping("/saveRating")
    public Result saveRating(@RequestParam Long bookId, @RequestParam Double score) {
        ratingService.saveRating(bookId, score);
        return Result.ok();
    }


}
